/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       material_display.h

	$Header: /game/material_display.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef MATERIAL_DISPLAY_H_INCLUDED
#define MATERIAL_DISPLAY_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <bitset>
#include <string>
#include "bitmap_group_ptr.h"
#include "game_window.h"
#include "materials.h"
#include "screen_point.h"
#include "text_window.h"
#include "text_window_ptr.h"

class t_player;

class t_material_display
{
public:
	t_material_display();
	void init( t_bitmap_group_ptr bitmaps, t_player* player, t_screen_point origin, t_window* parent );
	bool is_visible() const;
	void set_material_visible(	t_material type, bool arg = true );
	void set_player( t_player* player );
	void set_visible( bool visible );
	void update();

protected:
	t_text_window_ptr				m_material_text[k_material_count];
	t_player*						m_player;
	std::bitset<k_material_count> 	m_windows_active;
	t_window_ptr					m_window[k_material_count];
	bool							m_visible;
};


inline t_material_display::t_material_display()
	:	m_player( 0 ),
		m_visible( true )
{
	// set all the material windows to active
	m_windows_active.set();
}

inline bool t_material_display::is_visible() const
{
	return m_visible;
}


inline void t_material_display::set_player( t_player* player )
{
	m_player = player;
}

#endif // MATERIAL_DISPLAY_H_INCLUDED
